package com.project.bean;

/***
 * 汽车实体类
 */
public class CarBean {
    /**汽车编号*/
    private int id;
    /**品牌*/
    private String name;
    /**价格*/
    private  int price;
    /**所属公民*/
    private MasterBean masterBean;

    public CarBean() {
    }

    public CarBean(String name, int price,int masterId) {
        this.name = name;
        this.price = price;
        this.masterBean = new MasterBean();
        this.masterBean.setId(masterId);
    }

    public CarBean(String name, int price) {
        this.name = name;
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public MasterBean getMasterBean() {
        return masterBean;
    }

    public void setMasterBean(MasterBean masterBean) {
        this.masterBean = masterBean;
    }

    @Override
    public String toString() {
        return "CarBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", masterBean=" + masterBean +
                "}\n";
    }
}
